package com.twu.biblioteca.view.console.resolver;

import com.twu.biblioteca.enums.MapKey;
import com.twu.biblioteca.view.console.ViewResolver;

import java.util.Map;

public class MessageResolver implements ViewResolver {
  private static final String viewTemplate =
      "\n$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n" +
          "$  %-71s$\n" +
          "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n";

  public String getView(Map<MapKey, Object> model) {
    return String.format(viewTemplate, model.get(MapKey.Message));
  }
}
